<?php include("global-includes/breadcrumbs.php"); ?>

<?php
	$products = get_event_products($page["id"]);
	$productCount = count($products);
?>

<!-- EVENT CONTENT -->
<div class="col-md-<?php echo ($productCount > 0 ? "9" : "12"); ?>">
	<h1 class="sectionTitle"><?php echo $page["name"]; ?></h1>
	<div class="artilceDetails">
		<?php
			if(isset($_SESSION["language"]["month_names"]) && $_SESSION["language"]["month_names"] != "")
			{
				$monthNames = json_decode($_SESSION["language"]["month_names"], true);
			}
			
			if($monthNames)
			{
				$startMonth = $monthNames[date("n", $page["start_date"])];
				$endMonth = $monthNames[date("n", $page["end_date"])];
			}
			else
			{
				$startMonth = date("F", $page["start_date"]);
				$endMonth = date("F", $page["end_date"]);
			}
			
			$startDate = date("d", $page["start_date"]) . " " . $startMonth . " " . date("Y", $page["start_date"]);
			$endDate = date("d", $page["end_date"]) . " " . $endMonth . " " . date("Y", $page["end_date"]);
			
			$city = false;
			if($page["city_id"] > 0)
			{
				$city = $connection->fetch_row("cities", $page["city_id"], "id");
			}
				
		?>
		<div class="glyphicon glyphicon-calendar"></div> <?php echo $startDate ." - " . $endDate;?>
		<?php if($city):?>
			&nbsp;-&nbsp;<div class="glyphicon glyphicon-pushpin"></div><?php echo $city["name"]; ?>
		<?php endif; ?>
	</div>
	<div class="actions">
		<a href="#" title="" class="print pull-left"><?php echo translate("print"); ?></a>
		<a href="#" title="" class="mail pull-left"><?php echo ucfirst(translate("send_mail")); ?></a>
		
		<!--<div class="fb-like" data-href="<?php echo site_url().$page["url"]; ?>" data-width="450" data-layout="button_count" data-action="recommend" data-show-faces="true" data-send="false"></div>-->
		
		<a href="https://twitter.com/share" class="twitter-share-button pull-left">Tweet</a>
		<a href="#" title="" class="facebook-like pull-left">&nbsp;</a>
		<div class="g-plus pull-left" data-action="share" style="width:200px; float:left"></div>
		<div class="clearfix"></div>
	</div>
	<?php echo $page["description"]; ?>
	
	<?php if(isset($page["images"]) && count($page["images"])>0): ?>
		<?php include("html-includes/common/page-gallery.php"); ?>
	<?php endif; ?>
	
</div>
<!-- END EVENT CONTENT -->
<?php if($productCount > 0): ?>
	<!-- SIDEBAR --> 
		<?php include("html-includes/event/items/sidebar.php"); ?>
	<!-- END SIDEBAR -->
<?php endif; ?>
<div class="clearfix"></div>